package prefix.payment;

import java.util.List;

import processor.PayProcessor;

import models.Pay;

import repository.PayRepository;
import service.exception.PayException;

public class PaymentPullProcessor {

    public static void processPull() {
        List<Pay> pullList = PayRepository.getTodayPull();

        System.out.println("payment to pull : " + pullList.size());
        for (Pay pay : pullList) {
            processPull(pay);
        }

    }

    public static void processPull(Pay pay) {
        try {
            PayProcessor processor = new PayProcessor(pay);
            processor.validateForPull();
            processor.paymentPull();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}
